from selenium import webdriver
import time
from selenium.webdriver import Keys
from selenium.webdriver.common.by import By

dr = webdriver.Chrome()
dr.get("file:///C:/Users/Administrator/Desktop/自动化测试网页/自动化测试网页/注册A.html")
dr.maximize_window()
time.sleep(2)
# 先找到两个元素
e1 = dr.find_element(By.ID,"userA")
e2 = dr.find_element(By.ID,"telA")
# 先输入
e1.send_keys("123456")
time.sleep(2)
# 删除一个字符
e1.send_keys(Keys.BACKSPACE)
# 全选
e1.send_keys(Keys.CONTROL,"a")
# 复制
e1.send_keys(Keys.CONTROL,"c")
# 粘贴
e2.send_keys(Keys.CONTROL,"v")
time.sleep(2)
dr.quit()